home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / t2win-32 / _grad.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-13  |  4KB  |  127 lines

  1. VERSION 5.00
  2. Begin VB.Form frmGradient 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Gradient"
  5.    ClientHeight    =   4290
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   6600
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4290
  13.    ScaleWidth      =   6600
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   0
  19.       Top             =   -90
  20.       Width           =   6585
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   6210
  26.          TabIndex        =   5
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   5310
  35.          TabIndex        =   4
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   5670
  44.          TabIndex        =   3
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   1
  52.          Top             =   180
  53.          Width           =   3855
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   2
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64. Attribute VB_Name = "frmGradient"
  65. Attribute VB_GlobalNameSpace = False
  66. Attribute VB_Creatable = False
  67. Attribute VB_PredeclaredId = True
  68. Attribute VB_Exposed = False
  69. Option Explicit
  70. Option Base 1
  71. Private Const Iteration = 250
  72. Dim IsLoaded         As Integer
  73. Dim TimerStartOk     As Integer
  74. Dim TimerCloseOk     As Integer
  75. Dim TimerHandle      As Integer
  76. Dim TimerValue       As Long
  77. Private Sub cmdNP_Click(Index As Integer)
  78.    Call sub_NextPrev(cmb_Function, Index)
  79. End Sub
  80. Private Sub cmb_Function_Click()
  81.    If (IsLoaded = False) Then Exit Sub
  82.    Call cDisableFI(mdiT2W.Picture1)
  83.    DoEvents
  84.    Select Case cmb_Function.ListIndex
  85.       Case 0 To 7
  86.          Refresh
  87.       Case 8
  88.          Call TestPsychedelic
  89.       Case Else
  90.    End Select
  91.    DoEvents
  92.    Call cEnableFI(mdiT2W.Picture1)
  93. End Sub
  94. Private Sub Form_Activate()
  95.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  96. End Sub
  97. Private Sub Form_Load()
  98.    IsLoaded = False
  99.    Show
  100.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_grad.t2w")
  101.    IsLoaded = True
  102. End Sub
  103. Private Sub Form_Paint()
  104.    Dim OldScaleMode        As Integer
  105.    OldScaleMode = Me.ScaleMode
  106.    Me.ScaleMode = 3
  107.    cGradient Me.hDC, 0, 0, Me.ScaleWidth, Me.ScaleHeight, cmb_Function.ListIndex + 1, 0, vbBlue
  108.    'cTitleGradient Me.hWnd, Me.Icon, cmb_Function.ListIndex + 1, 0, vbGreen
  109.    Me.ScaleMode = OldScaleMode
  110. End Sub
  111. Private Sub Command1_Click()
  112.    Call cmb_Function_Click
  113. End Sub
  114. Private Sub TestPsychedelic()
  115.    Dim OldScaleMode        As Integer
  116.    OldScaleMode = Me.ScaleMode
  117.    Me.ScaleMode = 3
  118.      
  119.    Dim t             As Single
  120.    t = Timer
  121.    Do
  122.       cGradient Me.hDC, 0, 0, Me.ScaleWidth, Me.ScaleHeight, Int((8 * Rnd) + 1), 0, Int((&HFFFFFF * Rnd) + 1)
  123.       DoEvents
  124.    Loop Until ((Timer - t) > 4)
  125.    Me.ScaleMode = OldScaleMode
  126. End Sub
  127.